package byj.com.meishi.dao;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import byj.com.meishi.db.DbHelper;

/**
 * Created by Administrator on 2016/9/22 0022.
 */
public class ShouCangDao {
    private SQLiteDatabase db;
    public   ShouCangDao(Context context){
        DbHelper dbHelper = new DbHelper(context);
        db = dbHelper.getWritableDatabase();
    }
    //添加...
    public long insert(String table, ContentValues values) {

        return db.insert(table, null, values);
    }

    //查询...
    public Cursor select(String sql, String[] selectionArgs) {

        return db.rawQuery(sql, selectionArgs);
    }

    //删除...
    public int delete(String table, String whereClause, String[] whereArgs) {

        return db.delete(table, whereClause, whereArgs);
    }

    public void deleteBiao(String sql){
        db.execSQL(sql);
    }
}
